<template>
  <div class="dashboard-container">
    <el-row :gutter="20">
      <!-- 教学班级表格 - 占比40% -->
      <el-col :xs="24" :sm="24" :md="12" :lg="10" :xl="8">
        <el-card>
          <div slot="header">
            <span>教学班级详情</span>
          </div>
          <teacher-classes-table />
        </el-card>
      </el-col>
      
      <!-- 成绩分布柱状图 - 占比60% -->
      <el-col :xs="24" :sm="24" :md="12" :lg="14" :xl="16">
        <el-card>
          <div slot="header">
            <span>学生成绩分布</span>
          </div>
          <grade-distribution-bar-chart :course-id="currentCourseId" />
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import TeacherClassesTable from '@/components/TeacherClassesTable'
import GradeDistributionBarChart from '@/components/GradeDistributionBarChart'

export default {
  name: 'TeacherDashboard',
  components: {
    TeacherClassesTable,
    GradeDistributionBarChart
  },
  data() {
    return {
      currentCourseId: 'math101' // 当前课程ID
      
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard-container {
  padding: 20px;
  
  .el-card {
    margin-bottom: 20px;
    height: 500px; /* 固定高度保持一致性 */
    
    ::v-deep .el-card__body {
      height: calc(100% - 57px); /* 减去标题栏高度 */
      padding: 20px;
    }
  }
  
  /* 响应式调整 */
  @media (max-width: 768px) {
    .el-col {
      margin-bottom: 20px;
    }
  }
}
</style>